/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * CustomGraph.java
 *
 * Created on 08.mai.2012, 01:40:23
 */

package GUI;

import Gnuplot.Plot.Gnuplot;
import Gnuplot.Plot.GnuplotDateFormat;
import Gnuplot.Plot.GnuplotDateRange;
import Gnuplot.Plot.Plot;
import Gnuplot.Terminal.GnuplotTerminal;
import Gnuplot.Terminal.GnuplotTerminalPNG;
import Gnuplot.Terminal.GnuplotTerminalPostScript;
import Gnuplot.Terminal.GnuplotTerminalSVG;
import Ibutton.DeviceHandler.Hygrochron;
import Ibutton.DeviceHandler.Thermochron;
import com.dalsemi.onewire.OneWireException;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.ComboBoxModel;
import javax.swing.DefaultComboBoxModel;
import javax.swing.JFrame;

/**
 * Class used to generate customgraphs based on the data from the device. 
 * @author Baardsen
 */
public class CustomGraph extends javax.swing.JFrame {
    private boolean HYGROCHRON;
    private  Hygrochron hygrochron;
    private  Thermochron thermochron;

    /**
     * Getting the customgraph path, where all the custom graphs are saved.
     */
    public String customGraphFolder;

    /**
     * Starting a new custom graph process, where the user can create a custom graph based on the data selected.
     * @param owc
     * OneWireContainer with the current graph data
     * @param customFolderPath
     * Custom graph path
     * @throws OneWireException
     * @throws FileNotFoundException
     * @throws IOException
     */
    public CustomGraph(Object owc, String customFolderPath) throws OneWireException, FileNotFoundException, IOException {
        initComponents();
        this.customGraphFolder = customFolderPath;
       
	    //cast to correct device
        try{
            hygrochron = (Hygrochron) owc;
            HYGROCHRON = true;
        }catch(Exception e){
            thermochron = (Thermochron) owc;
        }
        this.customGraphFolder = System.getProperty("user.dir")+"\\Mission\\CustomGraph";
        setup();
        setupDateRangeList();
        setVisible(true);
        setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
        

    }

    /**
     * Loading all the dates into the comboboxes
     * @throws FileNotFoundException
     * @throws IOException
     */
    private void setupDateRangeList() throws FileNotFoundException, IOException{
        File f = null;
        if(HYGROCHRON)
             f = new File(hygrochron.HUMIDITY_RAW_DATA_NAME);
        else
            f = new File(thermochron.TEMPERATURE_RAW_DATA_NAME);

        //new file reader
        BufferedReader br = new BufferedReader(new FileReader(f));

        //lists for holding the dates
        DefaultComboBoxModel dcombo = new DefaultComboBoxModel();
        DefaultComboBoxModel dcombo2 = new DefaultComboBoxModel();
        
        String l;
        //reading the dates and adding them to the comboboxes
        while((l = br.readLine())!=null){
            String [] date = l.split(" ");
            dcombo.addElement(date[0]);
            dcombo2.addElement(date[0]);
        }
        stopDate.setModel(dcombo2);
        startDate.setModel(dcombo);
    }
    /**
     * Setting up title and showing boxes.
     * @throws OneWireException
     * @throws FileNotFoundException
     * @throws IOException
     */
    private void setup() throws OneWireException, FileNotFoundException, IOException{
        
        if(HYGROCHRON){
            setTitle(hygrochron.getAlternativeName() + " - " + hygrochron.getAdress());
        }else{
            setTitle(thermochron.getAlternativeName() + " - " + thermochron.getAdress());
            humidity.setVisible(false);
        }
        
        setupDateRangeList();
    }
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jFileChooser1 = new javax.swing.JFileChooser();
        jLabel1 = new javax.swing.JLabel();
        jPanel1 = new javax.swing.JPanel();
        jLabel5 = new javax.swing.JLabel();
        jLabel6 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        graphtitle = new javax.swing.JTextField();
        jLabel4 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jComboBox1 = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        startDate = new javax.swing.JComboBox();
        stopDate = new javax.swing.JComboBox();
        jLabel2 = new javax.swing.JLabel();
        graphName = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        size = new javax.swing.JComboBox();
        jLabel10 = new javax.swing.JLabel();
        grid_check = new javax.swing.JCheckBox();
        jLabel11 = new javax.swing.JLabel();
        ticks = new javax.swing.JComboBox();
        jPanel2 = new javax.swing.JPanel();
        jLabel3 = new javax.swing.JLabel();
        humidity = new javax.swing.JCheckBox();
        temperature = new javax.swing.JCheckBox();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setResizable(false);
        addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosed(java.awt.event.WindowEvent evt) {
                formWindowClosed(evt);
            }
        });

        jPanel1.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jLabel5.setText("Select Date range:");

        jLabel6.setText("Start date:");

        jLabel7.setText("Stop date:");

        jLabel4.setText("Graph title:");

        jButton1.setText("Create graph");
        jButton1.setToolTipText("Creating a new graph.");
        jButton1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton1ActionPerformed(evt);
            }
        });

        jComboBox1.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "png", "svg", "ps" }));
        jComboBox1.setToolTipText("Select the format you want to generate the graph to.");

        jLabel8.setText("Format:");

        startDate.setToolTipText("This is the start date range, where you want to start generating the graph.");

        stopDate.setToolTipText("This is the stop date, where the graph will stop generating.");

        jLabel2.setText("Graph name:");

        graphName.setToolTipText("The name of the graph, the filename of your choice.");

        jLabel9.setText("Size:");

        size.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "800x640", "1024x600", "1280x720", "1360x768", "1600x1200", "1920x1080" }));
        size.setToolTipText("Here you can select the size of the graph.");

        jLabel10.setText("Enable grid:");

        grid_check.setSelected(true);
        grid_check.setText("Grid enabled");
        grid_check.setToolTipText("This will display a grid on the graph generated.");

        jLabel11.setText("Set Y axis ticks:");

        ticks.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0.1", "0.2", "0.3", "0.4", "0.5", "0.6", "0.7", "0.8", "0.9", "1", "2", "3", "4", "5" }));

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel5)
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel7)
                        .addGap(30, 30, 30)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(stopDate, 0, 331, Short.MAX_VALUE)
                            .addComponent(jButton1)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jLabel11, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jLabel10, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addComponent(jLabel9)
                            .addComponent(jLabel8)
                            .addComponent(jLabel4)
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(grid_check)
                            .addComponent(size, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jComboBox1, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(graphName)
                            .addComponent(graphtitle, javax.swing.GroupLayout.DEFAULT_SIZE, 322, Short.MAX_VALUE)
                            .addComponent(ticks, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .addGroup(jPanel1Layout.createSequentialGroup()
                        .addComponent(jLabel6)
                        .addGap(28, 28, 28)
                        .addComponent(startDate, javax.swing.GroupLayout.PREFERRED_SIZE, 320, javax.swing.GroupLayout.PREFERRED_SIZE))))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2)
                    .addComponent(graphName, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel4)
                    .addComponent(graphtitle, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel8)
                    .addComponent(jComboBox1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(12, 12, 12)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel9)
                    .addComponent(size, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(11, 11, 11)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel10)
                    .addComponent(grid_check))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel11)
                    .addComponent(ticks, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel5)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel6)
                    .addComponent(startDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel7)
                    .addComponent(stopDate, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jButton1)
                .addContainerGap())
        );

        jPanel2.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));

        jLabel3.setText("Choose data you want to plot:");

        humidity.setText("Humidity");
        humidity.setToolTipText("Humidity data");

        temperature.setSelected(true);
        temperature.setText("Temperature");
        temperature.setToolTipText("Temperature data");

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel3)
                    .addGroup(jPanel2Layout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(humidity)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(temperature)))
                .addContainerGap(262, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addComponent(jLabel3)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(humidity)
                    .addComponent(temperature))
                .addContainerGap())
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jLabel1, javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanel2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jLabel1)
                    .addComponent(jPanel2, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    /**
     * Getting the format: jpg,svg or ps
     * @return
     * String with the format chosen
     */
    private String getFormat(){
        return (String)this.jComboBox1.getSelectedItem();
    }

    /**
     * Getting the data to plot
     * @return
     * String [] with the data files to plot
     */
    private String[] getDataToPlot(){
        String [] data;
       

        if(HYGROCHRON){
		    //plot both
            if(humidity.isSelected() && temperature.isSelected()){
                data = new String[2];
                data[0] = hygrochron.HUMIDITY_RAW_DATA_NAME;
                data[1] = hygrochron.TEMPERATURE_RAW_DATA_NAME;
			//plot humidity
            }else if(humidity.isSelected()){
                data = new String[1];
                data[0] = hygrochron.HUMIDITY_RAW_DATA_NAME;
			//temperature
            }else{
                data = new String[1];
                data[0] = hygrochron.TEMPERATURE_RAW_DATA_NAME;
            }
        }else{
            data = new String[1];
            data[0] = thermochron.TEMPERATURE_RAW_DATA_NAME;
        }
        return data;
    }

    /**
     * Getting the correct terminal based on user input
     * @param format
     * String with the format. svg, png or ps
     * @return
     * GnuplotTerminal with the correct terminal. SVG, PNG or PS
     */
    private GnuplotTerminal getTerminal(String format){
        if(format.equals("svg"))
            return new GnuplotTerminalSVG();
        else if(format.equals("png"))
            return new GnuplotTerminalPNG();
        else
            return new GnuplotTerminalPostScript();

    }

    /**
     * Method to check if the form submitted is valid
     * @return
     * true or false if the form is valid.
     */
    private boolean valid(){
        boolean valid = true;
        if(!humidity.isSelected() && !temperature.isSelected()){
            Box.Message("You forgot to set which data you wanted to use. Check humidity, temperature or both.");
            valid = false;
        }
        if(startDate.getSelectedItem() == stopDate.getSelectedItem()){
            Box.Message("You have selected the same date ranges from start to stop, please choose another entry.");
            valid = false;
        }
        return valid;

    }
    /**
     * Action called when the user clicks the create custom graph button
     * Drive method for generating the graph.
     * @param evt
     */
    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton1ActionPerformed
       if(valid()){
           String format = this.getFormat();
           String [] dataToPlot = getDataToPlot();
           String title = graphtitle.getText();

           //setting up the date range of values to be used
           GnuplotDateRange range = new GnuplotDateRange();
           range.startDate((String)startDate.getSelectedItem());
           range.stopDate((String)stopDate.getSelectedItem());

           //trying to begin a new plotting process
           try {
                this.plot(getTerminal(format), format, dataToPlot, title, range);
                Box.Message("Your custom graph has been generated!");
            } catch (Exception ex) {
                Box.Message("An error occoured when generating your graph.");
            }
       }
    }//GEN-LAST:event_jButton1ActionPerformed
    /**
     * Parsing the date to file friendly format
     * @param date
     * Old date format
     * @return
     * New date format for the file
     */
    private String fileFriendlyFormat(String date){
        return date.replace(":", "-");
    }

    /**
     * Method used to plot the custom graphs.
     * @param t
     * @param format
     * @param dataToPlot
     * @param title
     * @param range
     * @throws Exception
     */
    private void plot(GnuplotTerminal t, String format, String [] dataToPlot, String title, GnuplotDateRange range) throws Exception{
        //setting up GNUPLOT
        Gnuplot gnuplot = new Gnuplot();
        GnuplotTerminal terminal = t;
        String s = (String)size.getSelectedItem();
        terminal.setSize(s.replace("x", ","));
        gnuplot.setTerminal(terminal);
        gnuplot.setGrid(grid_check.isSelected());
        gnuplot.setYTicks(Double.parseDouble((String)ticks.getSelectedItem()));

        //date format
        GnuplotDateFormat f = new GnuplotDateFormat();
        f.setOldFormat(f.DEFAULT);
        f.setOutputFormat("%d.%m.%Y-%H:%M");

        gnuplot.setTitle(title);

        
        
        if(HYGROCHRON){
			//setting up filename
            String filename = String.format("%s\\%s_%s_%s_%s.%s",
                    customGraphFolder,
                    graphName.getText(),
                    fileFriendlyFormat((String)startDate.getSelectedItem()),
                    fileFriendlyFormat((String)stopDate.getSelectedItem()),
                    hygrochron.getAlternativeName(),
                    format);
            //graph name and output
            gnuplot.setOutputName(filename);
            System.out.println(filename);
                if(dataToPlot.length>1){
                //plotting both humidity and temperature
                Plot p = new Plot(
                        dataToPlot,
                        new String []{"1:2","1:2"},
                        new String []{Plot.GRAPH_COLOR_BLUE, Plot.GRAPH_COLOR_RED},
                        new String []{"Humidity","Temperature"},
                        new String []{Plot.GRAPH_LINESTYLE_LINES, Plot.GRAPH_LINESTYLE_LINES},
                        f,
                        range);
                gnuplot.plot(p);
                }else{
                    //getting the correct label
                    String label = "";
                    if(dataToPlot[0].toLowerCase().contains("humidity"))
                        label = "Humidity";
                    else
                        label = "Temperature";

                    //plotting single graph
                    Plot p = new Plot(
                            dataToPlot[0],
                            "1:2",
                            Plot.GRAPH_COLOR_BLUE, 
                            label,
                            Plot.GRAPH_LINESTYLE_LINEPOINTS,
                            f,
                            range
                            );
                      gnuplot.plot(p);
                }
        }else{
            String filename = String.format("%s\\%s_%s_%s_%s.%s",
                    customGraphFolder,
                    graphName.getText(),
                    fileFriendlyFormat((String)startDate.getSelectedItem()),
                    fileFriendlyFormat((String)stopDate.getSelectedItem()),
                    thermochron.getAlternativeName(),
                    format);
            gnuplot.setOutputName(filename);
       
            Plot p = new Plot(dataToPlot[0], "1:2", Plot.GRAPH_COLOR_BLUE, "Temperature", Plot.GRAPH_LINESTYLE_LINEPOINTS, f, range);
            gnuplot.plot(p);
        }
    }

    private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
       
    }//GEN-LAST:event_formWindowClosed

  
 

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JTextField graphName;
    private javax.swing.JTextField graphtitle;
    private javax.swing.JCheckBox grid_check;
    private javax.swing.JCheckBox humidity;
    private javax.swing.JButton jButton1;
    private javax.swing.JComboBox jComboBox1;
    private javax.swing.JFileChooser jFileChooser1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JComboBox size;
    private javax.swing.JComboBox startDate;
    private javax.swing.JComboBox stopDate;
    private javax.swing.JCheckBox temperature;
    private javax.swing.JComboBox ticks;
    // End of variables declaration//GEN-END:variables

}
